package sctu.edu.java.year2016.team01.chenhong.day20160520.chapter3_2;

import java.util.Scanner;

/**
 * Created by Administrator on 2016/5/21.
 * 声明两个int变量运用三元运算符判断他们是否相等，若不等，求最大值
 */
public class Compare {
    public static void main(String[] args) {

        System.out.println("请输入变量A的值：");
        Scanner scan = new Scanner(System.in);
        int A = scan.nextInt();

        System.out.println("请输入变量B的值：");
        int B = scan.nextInt();

        int z = A > B ? A : B;



        if (A == B)
            System.out.println("A与B相等都为" + A);
        else
            System.out.println("A与B的最大值:" + z);

    }
}